{*include file="template/admin_head.htm"*}

<table id="containtable" cellspacing="0" cellpadding="0" class="{*$cf_controller*}">
    <tr>
        <td width="1979" valign="top" bgcolor="#FFFFFF">


            <div class="wrapper pr_8">
		{*if $cf_action=='detail'*}
			 <script type="text/javascript">
			 function order_send(){
										
				$("#my_form").submit();
			
			}
			 function order_close(){				
				$("#act").val("close");				
				$("#my_form").submit();
			
			}
			
			function order_complete(){				
				$("#act").val("complete");				
				$("#my_form").submit();
			
			}
			
			function order_repay(){				
				$("#act").val("repay");				
				$("#my_form").submit();
			
			}
			
			 $(function(){
				 $("#order_send").click(function(){	
				 	if($("#order_express_company").val()==''){
						my_alert('请输入快递公司','提示',"$('#order_express_company').focus()");
						return false;	
					}
					if($("#order_express_number").val()==''){
						my_alert('请输入快递单号','提示',"$('#order_express_number').focus()");
						return false;	
					}					
					my_confirm("你确定要发货吗",'确认提示','order_send()');
												
					});
				$("#order_close").click(function(){	
					if($("#order_close_reason").val()==''){
						my_alert('请输入取消的原因','提示',"$('#order_close_reason').focus()");
						return false;	
					}				
					my_confirm("你确定要取消订单吗",'确认提示','order_close()');
											
				});	
							
				$("#order_complete").click(function(){					
					my_confirm("此订单确认完成吗? <br> 操作完成后代理商将获得返利资金",'确认提示','order_complete()');
											
				});
				
				$("#order_repay").click(function(){	
					if($("#order_repay_reason").val()==''){
						my_alert('请输入退款的原因','提示',"$('#order_repay_reason').focus()");
						return false;	
					}	
					if($("#order_repay_sn").val()==''){
						my_alert('请输入退款单流水号','提示',"$('#order_repay_sn').focus()");
						return false;	
					}			
					my_confirm("你确定要进行退款吗?",'确认提示','order_repay()');
											
				});	
				 
			})
			 </script>
				
                <div class="content_panel_title">
                    <div class="contentpanelleft"></div>
                    <div class="contentpanelcenter">
                    <span class="contentpanelcenter_font">订单详细信息</span>
                    <span><a class="edit at" href="{*$cf_self_page*}?dpt={*$cf_dpt*}">订单管理</a></span>
                    </div>
                    <div class="contentpanelrihgt"></div>
				</div>
                
                
                <div class="content_table_center_style">
                    <div class="p8">
						<form  name="my_form" id="my_form" method="post" action="{*$cf_module_path*}order.htm">
                        <input name="act" id="act" value="send" type="hidden" />
                		<input name="id" value="{*$row.order_id*}" type="hidden" />
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tbl tbl_nbr">
                                <tbody>
							
									<tr>
                                        <td colspan="4" class="stitle">订单信息</td>
                                    </tr>									
                                    <tr>
                                    	<td width="15%" align="right">订单号:</td>
                                    	<td width="34%" align="left">{*$row['order_sn']*}({*$cf_info_var_common['order_status'][$row['order_status']]*})</td>
                                    	<td width="16%" align="right">下单时间:</td>
                                    	<td width="35%" align="left">{*$row['order_create_time']*}</td>
                                   	</tr>
                                    <tr>
                                        <td align="right">订单总价:</td>
                                        <td align="left">{*$row['order_total']*}</td>
                                        <td align="right">快递费用:</td>
                                        <td align="left">{*$row['order_express_fee']*}</td>
                                    </tr>									
									<tr>
                                        <td align="right">全费用:</td>
                                        <td align="left">{*$row['order_all_total']*} (含快递费)</td>
                                        <td align="right">推荐者:</td>
                                        <td align="left">{*$row['order_puser']*}</td>
                                    </tr>
									<tr>
										<td align="right">备注:</td>
										<td align="left"><b style="color:red;">{*$row['order_comment']*}</b></td>
										<td align="right">&nbsp;</td>
										<td align="left">&nbsp;</td>
									</tr>									
									<!--<tr>
                                        <td align="right"> 订单运费:</td>
                                        <td align="left">{*$row['order_fare']*}</td>
                                        <td align="right">订单优惠</td>
                                        <td align="left">{*$row['order_promotion']*}</td>
                                    </tr>-->
									<tr>
                                        <td colspan="4" class="stitle">收货人信息</td>
                                    </tr>
									
									<tr>
                                        <td align="right">姓名:</td>
                                        <td align="left">{*$row['order_name']*}</td>
                                        <td align="right">联系电话:</td>
                                        <td align="left">{*$row['order_phone']*}</td>
                                    </tr>
									<!--<tr>
                                        <td align="right">邮编:</td>
                                        <td align="left">{*$row['order_zip_code']*}</td>
                                        <td align="right">Email:</td>
                                        <td align="left">{*$row['order_email']*}</td>
                                    </tr>-->
									<tr>
                                    	<td align="right">收货地址:</td>
                                    	<td colspan="3" align="left">{*$row['order_addr']*}</td>
                                   	</tr>
									{*if $row['order_remark']*}
									<tr>
                    <td align="right">备注:</td>
                    <td colspan="3" align="left"><b style="color:red;">{*$row['order_remark']*}</b></td>
                  </tr> 
									
									{*/if*} 
									<tr>
                                        <td colspan="4" class="stitle">商品详情</td>
                                    </tr>
									<tr>
								    <td align="right">清单:</td>
								    <td colspan="3" align="left">
                                    
                                        <table width="100%" class="tbl tbl_nbr">
                                          <tr align="center" bgcolor="#F2F2F2">
                                            <th width="9%">品牌</th>
                                            <th width="11%">商品标题</th>
                                            <th width="10%">类型</th>
                                            <th width="7%">数量</th>
                                            <th width="8%">单价</th>
                                            <th width="18%">服务费</th>
                                            <th width="19%">合计</th>
                                          </tr>
                                          {*foreach $row['order_detail'] as $item*} 
                                          {*foreach $item as $v*}  
                                          <tr style="border: 1px solid #ececec;; padding: 0px;margin: 0px;">
                                            <td style="border: 1px solid #ececec;; padding: 0px;margin: 0px;">{*$v['brand_name']*}</td>
                                            <td><a href="/default/goods-act_detail_id_{*$v['item_id']*}.htm" target="_blank">{*$v['item_name']*}</a></td>
                                            <td align="center">{*$v['item_option']*}</td>
                                            <td align="center">{*$v['item_cnt']*}</td>
                                            <td align="center">￥{*$v['item_price']*}</td>
                                            <td>
                                            {*if $v['item_surcharge']*}
                                            <ul>
                                            {*foreach $v['item_surcharge'] as $vv*}
                                            <li>{*$vv['title']*}(费用:{*$vv['fee']*})</li>
                                            {*/foreach*}
                                            </ul>
                                            {*/if*}                                            </td>
                                            <td>￥{*$v['item_pay_total']*}</td>
                                          </tr>
                                          {*/foreach*}
                                         {*/foreach*}                                     
                                      </table>							
									
									</td>
								    </tr>
									<tr>
                                        <td colspan="4" class="stitle">订单情况</td>
                                    </tr>
									<tr>
                                        <td align="right">状态:</td>
                                        <td align="left">{*$cf_info_var_common['order_status'][$row['order_status']]*}</td>
                                        <td align="right"></td>
                                        <td align="left"></td>
                                    </tr>
                                    {*if $row['order_express_company_name']*}
                                    <tr>
                                        <td colspan="4" class="stitle">快递信息</td>
                                    </tr> 
																		<tr>
                                        <td align="right">快递公司:</td>
                                        <td align="left">{*$row.order_express_company_name*}</td>
                                        <td align="right">快递单号:</td>
                                        <td align="left">{*$row.order_express_number*}</td>
                                    </tr>
									
																		<tr>
                                    	<td align="right">快递备注:</td>
                                    	<td colspan="3" align="left">{*$row['order_express_remark']*}</td>
                                   	</tr>
                                    
                                    <tr>
                                    <td align="right">快递跟踪:</td>
                                    <td colspan="3" align="left">
                                    		<table width="100%" border="0">
                                        {*foreach $row['express_info'] as $v*}
                                        <tr>
                                          <td width="12%" align="center">{*$v['time']*}</td>                                          
                                          <td width="88%">{*$v['context']*}</td>
                                        </tr>
                                        {*foreachelse*}
                                        <tr>
                                          <td colspan="2">没有快递信息</td>
                                        </tr>
                                        {*/foreach*}                                        
                                      </table>
                                    
                                    </td>
                                    </tr>
																	{*/if*}
                                  
                                  
                                    
                                    {*if $row['order_return_time'] && $row['order_pay_sn']*}
                                    <tr>
                                    <td align="right">订单支付时间:</td>
                                    <td align="left">{*$row['order_return_time']*}</td>
                                    <td align="right">流水号:</td>
                                    <td align="left">{*$row['order_pay_sn']*}({*$cf_info_var_common['pay_from'][$row['order_pay_from']]*})</td>
                                  </tr>
                                    {*/if*}                                    
                                    
									{*if $row['order_status'] == '0'*}
									<tr>
                                        <td colspan="4" class="stitle">取消订单操作</td>
                                    </tr> 
									<tr>
                                        <td align="right">取消原因:</td>
                                        <td align="left" colspan="3"><input type="text" id="order_close_reason" name="order_close_reason" size="40" /><input type="button" id="order_close" value="取消订单" class="myinput" /></td>                                        
                                    </tr>									
									{*elseif $row['order_status'] == '1'*}									
									<tr>
                                        <td colspan="4" class="stitle">发货操作</td>
                                    </tr> 
									<tr>
                                        <td align="right">快递公司:</td>
                                        <td align="left">{*html_options id=order_express_company name=order_express_company options=$cf_info_var_common['express_company']  selected=$row['express_company']|default:''*}</td>
                                        <td align="right">快递单号:</td>
                                        <td align="left"><input type="text" id="order_express_number" name="order_express_number" size="20" /></td>
                                    </tr>
									<tr>
                                    	<td align="right">快递备注:</td>
                                    	<td colspan="3" align="left"><input name="order_express_remark" type="text" id="order_express_remark" value="" size="80" />
                                   		<input type="button" id="order_send" value="发货提交" class="myinput" /></td>
                                   	</tr>
									<tr>
                                        <td colspan="4" class="stitle">订单退款操作</td>
                                    </tr> 
									<tr>
                                        <td align="right">退款原因:</td>
                                        <td align="left" colspan="3"><input type="text" id="order_repay_reason" name="order_repay_reason" size="40" />退款单流水号:<input type="text" id="order_repay_sn" name="order_repay_sn" size="20" /><input type="button" id="order_repay" value="订单退款" class="myinput" /></td>                                        
                                    </tr>
									 <tr>
										<td colspan="4" align="center">&nbsp;</td>
									</tr>					
								
									{*elseif $row['order_status'] == '2'*}									
									<tr>
                                    	<td align="right">发货时间:</td>
                                    	<td colspan="3" align="left">{*$row.order_express_time*}</td>
                                   	</tr>
									<tr>
                                        <td colspan="4" class="stitle">订单完成操作</td>
                                    </tr>									
									<tr>
                                        <td align="right">确认完成:</td>
                                        <td align="left" colspan="3"><input type="button" id="order_complete" value="完成订单" class="myinput" /><span class="red">（用户收到货后，可以执行完成订单操作）</span></td>
                                        
                                    </tr>
									<tr>
                                        <td colspan="4" class="stitle">订单退款操作</td>
                                    </tr> 
									<tr>
                                        <td align="right">退款原因:</td>
                                        <td align="left" colspan="3"><input type="text" id="order_repay_reason" name="order_repay_reason" size="40" />退款单流水号:<input type="text" id="order_repay_sn" name="order_repay_sn" size="20" /><input type="button" id="order_repay" value="订单退款" class="myinput" /></td>                                        
                                    </tr>
									
									{*elseif $row['order_status'] == '3'*}									
									<tr>
                                    	<td align="right">订单完成时间:</td>
                                    	<td colspan="3" align="left">{*$row.order_complete_time*}</td>
                                   	</tr>
									<tr>
                                        <td colspan="4" class="stitle">快递信息</td>
                                    </tr> 
									<tr>
                                        <td align="right">快递公司:</td>
                                        <td align="left">{*$row.order_express_company*}</td>
                                        <td align="right">快递单号:</td>
                                        <td align="left">{*$row.order_express_number*}</td>
                                    </tr>
									{*if $row.order_express_remark *}
									<tr>
                                    	<td align="right">快递备注:</td>
                                    	<td colspan="3" align="left">{*$row.order_express_remark*}</td>
                                   	</tr>
									{*/if*}
									
									
										
									{*elseif $row['order_status'] == '4'*}									
									<tr>
                                        <td colspan="4" class="stitle">订单取消信息</td>
                                    </tr>
									<tr>
                                    	<td align="right">取消原因:</td>
                                    	<td colspan="3" align="left">{*$row.order_close_reason*}</td>
                                   	</tr>
									<tr>
                                        <td align="right">操作人员:</td>
                                        <td align="left">{*$row.order_close_operator*}</td>
                                        <td align="right">操作时间:</td>
                                        <td align="left">{*$row.order_close_time*}</td>
                                    </tr>	
									{*elseif $row['order_status'] == '5'*}									
									<tr>
                                        <td colspan="4" class="stitle">订单退款信息</td>
                                    </tr>
									<tr>
                                        <td align="right">退款原因:</td>
                                        <td align="left">{*$row.order_repay_reason*}</td>
                                        <td align="right">退款单流水号:</td>
                                        <td align="left">{*$row.order_repay_sn*}</td>
                                    </tr>
									<tr>
                                        <td align="right">操作人员:</td>
                                        <td align="left">{*$row.order_repay_operator*}</td>
                                        <td align="right">操作时间:</td>
                                        <td align="left">{*$row.order_repay_time*}</td>
                                    </tr>															
									{*/if*}                                
									
                                </tbody>
                          </table>
					  </form>
           
                 </div>
                </div>
              
                <div class="content_main_bottom">
                    <div class="content_main_bottom_left"></div>
                    <div class="content_main_bottom_right"></div>
                </div>
            
            
            

                {*else*}

                <script type="text/javascript">
				$(function(){
					$("#skey6").autocomplete("/admin/ajax-act_searchuser.htm", {
							minChars: 1,					//最少输入字条
							max: 12,
							autoFill: false,				//是否选多个,用","分开
							mustMatch: true,				//是否全匹配, 如数据中没有此数据,将无法输入
							matchContains: true,			//是否全文搜索,否则只是前面作为标准
							scrollHeight: 220,
							width:450,
							multiple:false,
							dataType:'html',
							formatItem: function(row, i, max) {					//显示格式						
								return "<span style='width:120px'>"+row[0]+"</span><span style='width:70px'>ID:"+row[1]+"</span><span style='width:80px'>"+row[2]+"</span><span style='width:80px'>"+row[3]+"</span>";
							},
							formatMatch: function(row, i, max) {				//以什么数据作为搜索关键词,可包括中文,
							   return row[1];
					
							},
							formatResult: function(row) {					//返回结果		
								return row[0];
							}
						});
						
				})
				</script>
                <div class="pannel">
                    <div class="pl"></div>
                    <div class="pr"></div>
                    <div class="pc1">
                        <form action="" method="get" id="search_form" name="search_form">
                            <input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
                            <input name="self" id="self" type="hidden" value="{*$self*}" />
                            <div class="pt">
                              订单号:<input type="text" size="20" id="skey" name="skey" class="tet" value="{*$skey*}" />&nbsp;&nbsp;
                         	  收货人: 
                         	  <input type="text" size="20" id="skey3" name="skey3" class="tet" value="{*$skey3*}" />
                         	  &nbsp;&nbsp;
							  用户: 
							  <input type="text" size="20" id="skey6" name="skey6" class="tet" value="{*$skey6*}" />&nbsp;&nbsp;
							  下单时间:
                                <input name="skey4" class="Wdate" type="text" id="act_start" value="{*$skey4*}" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'act_end\')}',dateFmt:'yyyy-MM-dd',isShowClear:true,readOnly:true});" size="15" maxlength="30" />
                                到<input name="skey5" class="Wdate" type="text" id="act_end" value="{*$skey5*}" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'act_start\')}',dateFmt:'yyyy-MM-dd',isShowClear:true,readOnly:true});" size="15" maxlength="30" />                     		     
                                <input type="image" src="public/images/admin/icon_search_btn.gif" />
                            </div>
                        </form>
                    </div>
                </div>
                <div class="content_panel_title">
                    <div class="contentpanelleft"></div>
                    <div class="contentpanelcenter">
                        <span class="contentpanelcenter_font">订单管理</span>
                        <span><!--<a class="edit at" href="{*$cf_self_path*}-act_add.htm?dpt={*$cf_dpt*}">添加兑换订单</a>--></span>&nbsp;
		    </div>
                    <div class="contentpanelrihgt"></div>
                </div>
                <div class="content_table_center_style">
                    <div class="p8">
                        <div class="bq clearfix">
			    <b><a href="{*$cf_self_path*}-act_index.htm?dpt={*$cf_dpt*}" class="{*if $self==''*}active{*/if*}">所 有 </a>
				<!--<ul class="oul">
					<li><a href="#">刚好五个字</a></li>
					<li><a href="#">aaaa</a></li>
					<li><a href="#">aaaa</a></li>
				</ul>-->
				</b>
			    {*foreach $cf_info_var_common['order_status'] as $key=>$item*}
			    {*if $key==$self && $self!=''*}
			    {*assign var=class value='active'*}
			    {*else*}
			    {*assign var=class value=''*}
			    {*/if*}
			    <b><a href="{*$cf_self_path*}-act_index.htm?dpt={*$cf_dpt*}&self={*$key*}" class="{*$class*}" >{*$item*}</a>
					<!--<ul class="oul">
						{*foreach $cf_var_cate as $vv*}
						<li><a href="{*$cf_self_page*}?dpt={*$cf_dpt*}&self={*$key*}&cate={*$vv['id']*}">{*$vv['title']*}</a></li>
						{*/foreach*}

						
					</ul>-->
					</b>
			    {*/foreach*}
			</div>
                        <form name="list_form" id="list_form" method="post" action="{*$cf_self_page*}">
                            <input name="act" type="hidden" value="all" />
                            <input name="dpt" type="hidden" value="{*$cf_dpt*}" />
                            <table width="100%" class="tbl tbl_nbr">
                                <thead>
                                    <tr class="thd">
                                        <td width="4%" align="center" class="thr">ID</td>
                                        <td width="12%" align="center" class="thr">订单号</td>
                                        <td width="24%" align="center" class="thr">订单商品</td>
                                        <td width="4%" align="center" class="thr">数量</td>
                                        <td width="7%" align="center" class="thr">订单总额</td>
                                        <td width="6%" align="center" class="thr">收货人</td>
                                        <td width="11%" align="center" class="thr">联系电话</td>
                                        <td width="13%" align="center" class="thr">下单时间</td>
                                        <td width="8%" align="center" class="thr">客户</td>
                                        <td width="6%" align="center" class="thr">状态</td>
                                        <td colspan="2" align="center" class="thr">操作</td>
                                    </tr>
                                </thead>
                                <tbody>
                                    {*foreach $data_ary as $item*}
                                   

                                    <tr onmouseout="this.style.backgroundColor='#ffF'" onmouseover="this.style.backgroundColor='#ffC'">
                                        <td align="center">  {*$item['order_id']*}</td>
                                        <td align="left"><a href="{*$cf_self_path*}-act_detail_id_{*$item['order_id']*}.htm?dpt={*$cf_dpt*}" class="edit" target="_blank">{*$item['order_sn']*}</a></td>
                                        <td align="left">
										{*foreach $item['order_detail'] as $v2*}
                                        {*foreach $v2 as $v3*}                                       
										{*$v3['item_name']*}  {*$v3['item_option']*}<br />
                                        {*/foreach*}
										{*/foreach*} 
										</td>
                                        <td align="center">{*$item['order_total_count']*}</td>
                                        <td align="center"><span class="orange">
                                        	{*$item['order_all_total']*}
                                        </span></td>
                                        <td align="center"><span class="orange">
						{*$item['order_name']*}
					    </span></td>
                                        <td align="center"><span class="orange">
                                        	{*$item['order_phone']*}
                                        </span></td>
                                        <td align="center"><span class="orange">
                                        	{*$item['order_create_time']*}
                                        </span></td>
                                        <td align="center">{*$item['order_user']*}</td>
                                        <td align="center">{*$cf_info_var_common['order_status'][$item['order_status']]*}</td>
                                        <td width="5%" align="center">
                                        <a href="{*$cf_self_path*}-act_detail_id_{*$item['order_id']*}.htm?dpt={*$cf_dpt*}" class="edit" target="_blank">详情</a>
                                  			<a href="{*$cf_self_path*}-act_del_id_{*$item['order_id']*}.htm?dpt={*$cf_dpt*}" class="red" target="_blank">删除</a>
                                        </td>

                                    </tr>

                                    {*/foreach*}


                                    <tr class="tft">
                                        <td colspan="11" style="padding:0;">
                                            <table width="100%" border="0">
                                                <tr>
                                                    <td width="3%" align="center" style="border:0;padding:0;"><!--合计:--></td>
                                                    <td width="5%" align="center" style="border:0;padding:0;"><!--共:<span class="blue">{*$total_count*}</span>&nbsp;&nbsp;&nbsp;&nbsp;已完成:<span class="blue">{*$real_count*}</span>--></td>
                                                    <td width="92%" style="border:0;padding:0;" ><div class="turnPage"><p>{*$page*}</p></div></td>
                                                </tr>
                                            </table>
                                      </td>
                                    </tr>
                                </tbody>
                            </table>
                        </form>
                    </div>
                </div>
                <div class="content_main_bottom">
                    <div class="content_main_bottom_left"></div>
                    <div class="content_main_bottom_right"></div>
                </div>

                {*/if*}
            </div>        </td>
    </tr>
</table>
{*include file="template/admin_foot.htm"*}